/**
 * 2016年9月24日
 */
package jdk;
import java.util.ArrayDeque;
/**
 * @author Alex
 *
 */
public class VolatileTest {
	public static boolean run = true;
	/**
	 * @param args
	 * 
	 */
	
	static class Work1 extends Thread{
		public void run(){
		
			while(run){
				System.out.println("line");
				System.out.flush();
			}
		}
	}
	static class Work2 extends Thread{
		public void run(){
			run = false;
			System.out.println("run == false");
		}
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Work1().start();
		new Work2().start();

	}

}


